/* calloc example */
#include <stdio.h>
#include <stdlib.h>

int main()
{
  int i, n;
  int *pData;
  printf("Amount of numbers to be entered: ");
  scanf("%d", &i);
  pData = (int*)calloc(i, sizeof(int));
  if (pData == NULL) exit(1);
  for (n = 0; n < i; n++) {
    printf("Enter number #%d: ", n);
    scanf("%d", &pData[n]);
  }
  printf("You have entered: ");
  for (n = 0; n < i; n++) printf("%d ", pData[n]);
  free(pData);
  return 0;
}
